package com.qidian.mes.device.controller;

import com.qidian.common.pojo.MESResult;
import com.qidian.mes.device.service.LedgerService;
import com.qidian.mes.pojo.Ledger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 刘泽磊
 * @Company 起点编程
 * @Description
 * @Time 2024/10/17 19:05
 */
@RestController
@RequestMapping("/ledger")
@CrossOrigin
public class LedgerController {
    @Autowired
    private LedgerService ledgerService;
    @GetMapping("/list")
    public MESResult list(Ledger ledger){
        return ledgerService.select(ledger);
    }
    @PostMapping("/insert")
    public MESResult insert(@RequestBody Ledger ledger){
        return ledgerService.insert(ledger);
    }
    @PutMapping("/update")
    public MESResult update(@RequestBody Ledger ledger){
        return ledgerService.update(ledger);
    }
    @PutMapping("/updateScms")
    public MESResult updateScms(@RequestBody Ledger ledger){
        return ledgerService.updateScms(ledger);
    }
    @GetMapping("/selectById")
    public MESResult selectById(Long ledgerId){
        return ledgerService.selectById(ledgerId);
    }
    @DeleteMapping("/delete")
    public MESResult delete(Long ledgerId){
        return ledgerService.delete(ledgerId);
    }
}
